/// created by hcl
/// on 2025/5/9
/// NoteDetailModel
/// desc
class ClassModel {
  String name = '';
  String teacher = '';
  String room = '';
  String mark = '';

  ClassModel(this.name, this.teacher, this.room, this.mark);

  ClassModel.fromMap(Map<String, dynamic> map) {
    name = map['name'] ?? '';
    teacher = map['teacher'] ?? '';
    room = map['room'] ?? '';
    mark = map['mark'] ?? '';
  }

  Map<String, dynamic> toMap() {
    Map<String, dynamic> map = {};
    map['name'] = name;
    map['teacher'] = teacher;
    map['room'] = room;
    map['mark'] = mark;
    return map;
  }

  ClassModel copyWith({
    String? name,
    String? teacher,
    String? room,
    String? mark,
  }) {
    return ClassModel(
      name ?? this.name,
      teacher ?? this.teacher,
      room ?? this.room,
      mark ?? this.mark,
    );
  }

  @override
  String toString() {
    return toMap().toString();
  }
}
